import axios from 'axios';
import * as constants from './constants';

const changeDetail = (data) => ({
  type: constants.GET_WORKDATA,
  workData: data
});

export const getWorkData = () => {
  return (dispatch) => {
    axios.get('http://localhost:9080/work/all?start=0&length=20&enabled=1&checked=1',).then((res) => {
      dispatch(changeDetail(res.data.data));
    }).catch((res)=>{
      console.log(res);
    })
  }
 }